﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace School
{
    public class Student
    {
        private string name;
        private int fNumber;

        public Student(string name, int fNumber)
        {
            if (name == "" || name == String.Empty)
                throw new ArgumentException();
            if (fNumber <= 10000 || FNumber >= 99999)
                throw new ArgumentOutOfRangeException();
            this.name = name;
            this.fNumber = fNumber;
        }

        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }

        public int FNumber
        {
            get
            {
                return fNumber;
            }
            set
            {
                fNumber = value;
            }
        }
        public override bool Equals(object o)
        {
            Student s = o as Student;
            if (s == null)
            {
                return false;
            }
            return this.fNumber == s.fNumber && this.name == s.name;
        }

        public override int GetHashCode()
        {
            return this.name.GetHashCode() ^ this.fNumber.GetHashCode();
        }
    }
}
